import { ApiCall } from "tsrpc";
import { ReqList, ResList } from "../../../../shared/master/shop/equip/PtlList";
import god from "../../../../god";
import { Tpl_shop_default, template } from "../../../../shared/master/MsgAction";
import { player } from "../../../../model/fight/body/player";
export default async function (call: ApiCall<ReqList, ResList>) {
    call.succ({})
    let user = call.req._player as player;
    god.check();

    let tpl: Tpl_shop_default = {
        title: "装备商店",
        desc: "主神空间为各位轮回者们提供了最下级的装备",
        list: [],
        tips_look: "查看装备商店",
        tips_buy: "购买装备"
    }
    god.shop_equip.items.forEach(element => {
        if (element) {
            tpl.list.push({ name: element.getStyleName(), type: element.min_type, cont: element.num, price: element.value });
        } else {
            tpl.list.push(undefined)
        }
    })
    user.sendMsg(template.通用商店, tpl);
}